package com.weixin.paleituo.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * 我的佣金 总佣金bean
 *
 * @author fengzhen
 * @version v1.9, 2018/5/11
 */
public class SumBrokerageBean implements Parcelable {

    /**
     * balance : 4444.0
     * list : [{"id":9,"token":null,"pushSign":null,"rows":10,"page":1,"sort":null,"order":"asc","balanceId":2,"money":33,"updateTime":"2018-05-11 17:50:12","addOrDel":1,"type":2,"moneyString":"+33.00","phone":null,"start":0},{"id":8,"token":null,"pushSign":null,"rows":10,"page":1,"sort":null,"order":"asc","balanceId":2,"money":99,"updateTime":"2018-05-11 17:49:53","addOrDel":1,"type":1,"moneyString":"+99.00","phone":null,"start":0},{"id":7,"token":null,"pushSign":null,"rows":10,"page":1,"sort":null,"order":"asc","balanceId":2,"money":100,"updateTime":"2018-05-11 17:49:30","addOrDel":1,"type":1,"moneyString":"+100.00","phone":null,"start":0},{"id":6,"token":null,"pushSign":null,"rows":10,"page":1,"sort":null,"order":"asc","balanceId":2,"money":200,"updateTime":"2018-05-11 17:08:30","addOrDel":2,"type":2,"moneyString":"-200.00","phone":null,"start":0},{"id":5,"token":null,"pushSign":null,"rows":10,"page":1,"sort":null,"order":"asc","balanceId":2,"money":100,"updateTime":"2018-05-11 17:08:04","addOrDel":1,"type":2,"moneyString":"+100.00","phone":null,"start":0}]
     */

    private double balance;
    private List<ListBean> list;

    protected SumBrokerageBean(Parcel in) {
        balance = in.readDouble();
        list = in.createTypedArrayList(ListBean.CREATOR);
    }

    public static final Creator<SumBrokerageBean> CREATOR = new Creator<SumBrokerageBean>() {
        @Override
        public SumBrokerageBean createFromParcel(Parcel in) {
            return new SumBrokerageBean(in);
        }

        @Override
        public SumBrokerageBean[] newArray(int size) {
            return new SumBrokerageBean[size];
        }
    };

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public List<ListBean> getList() {
        return list;
    }

    public void setList(List<ListBean> list) {
        this.list = list;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeDouble(balance);
        dest.writeTypedList(list);
    }

    public static class ListBean implements Parcelable{
        /**
         * id : 9
         * token : null
         * pushSign : null
         * rows : 10
         * page : 1
         * sort : null
         * order : asc
         * balanceId : 2
         * money : 33.0
         * updateTime : 2018-05-11 17:50:12
         * addOrDel : 1
         * type : 2
         * moneyString : +33.00
         * phone : null
         * start : 0
         */

        private int id;
        private Object token;
        private Object pushSign;
        private int rows;
        private int page;
        private Object sort;
        private String order;
        private int balanceId;
        private double money;
        private String updateTime;
        private int addOrDel;
        private int type;
        private String moneyString;
        private Object phone;
        private int start;

        protected ListBean(Parcel in) {
            id = in.readInt();
            rows = in.readInt();
            page = in.readInt();
            order = in.readString();
            balanceId = in.readInt();
            money = in.readDouble();
            updateTime = in.readString();
            addOrDel = in.readInt();
            type = in.readInt();
            moneyString = in.readString();
            start = in.readInt();
        }

        public static final Creator<ListBean> CREATOR = new Creator<ListBean>() {
            @Override
            public ListBean createFromParcel(Parcel in) {
                return new ListBean(in);
            }

            @Override
            public ListBean[] newArray(int size) {
                return new ListBean[size];
            }
        };

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public Object getToken() {
            return token;
        }

        public void setToken(Object token) {
            this.token = token;
        }

        public Object getPushSign() {
            return pushSign;
        }

        public void setPushSign(Object pushSign) {
            this.pushSign = pushSign;
        }

        public int getRows() {
            return rows;
        }

        public void setRows(int rows) {
            this.rows = rows;
        }

        public int getPage() {
            return page;
        }

        public void setPage(int page) {
            this.page = page;
        }

        public Object getSort() {
            return sort;
        }

        public void setSort(Object sort) {
            this.sort = sort;
        }

        public String getOrder() {
            return order;
        }

        public void setOrder(String order) {
            this.order = order;
        }

        public int getBalanceId() {
            return balanceId;
        }

        public void setBalanceId(int balanceId) {
            this.balanceId = balanceId;
        }

        public double getMoney() {
            return money;
        }

        public void setMoney(double money) {
            this.money = money;
        }

        public String getUpdateTime() {
            return updateTime;
        }

        public void setUpdateTime(String updateTime) {
            this.updateTime = updateTime;
        }

        public int getAddOrDel() {
            return addOrDel;
        }

        public void setAddOrDel(int addOrDel) {
            this.addOrDel = addOrDel;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        public String getMoneyString() {
            return moneyString;
        }

        public void setMoneyString(String moneyString) {
            this.moneyString = moneyString;
        }

        public Object getPhone() {
            return phone;
        }

        public void setPhone(Object phone) {
            this.phone = phone;
        }

        public int getStart() {
            return start;
        }

        public void setStart(int start) {
            this.start = start;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(id);
            dest.writeInt(rows);
            dest.writeInt(page);
            dest.writeString(order);
            dest.writeInt(balanceId);
            dest.writeDouble(money);
            dest.writeString(updateTime);
            dest.writeInt(addOrDel);
            dest.writeInt(type);
            dest.writeString(moneyString);
            dest.writeInt(start);
        }
    }
}
